package com.hycreate.platform.modules.crm.findcustomer;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hycreate.platform.common.service.CrudService;

/**
 * 客户联系记录的业务层
 * */
@Service
@Transactional(readOnly = true)
public class FindCustomerRecordService extends CrudService<FindCustomerRecordDao, FindCustomerRecord> {
	
	@Autowired
	private FindCustomerRecordDao recordDao;

	/**
	 * 根据客户查询最近10次联系记录
	 * */
	public List<FindCustomerRecord> findTenRecordsByCustomer(String customerId) {
		return recordDao.findTenRecordsByCustomer(customerId);
	}

	@Transactional(readOnly = false)
	public void addRecordForCustomer(FindCustomerRecord record) {
		recordDao.insert(record);
	}

}
